<template>
  <div class="info-root">
    <div class="info-title">
      <span style="color: #0b2e13"><b>项目名称</b></span>&nbsp;&nbsp;
      <span style="color: green">[{{ record.PROJECTCODE }}]</span>&nbsp;&nbsp;
      <span>[同步状态：同步]</span>
    </div>
    <div class="info-left">
      <div class="data-title">本地数据</div>
      <div class="data-content">
        <a-collapse v-model:activeKey="activeNames" v-if="this.compareData">
          <a-collapse-panel key="1" header="基本信息">
            <div>项目名称：基本信息</div>
          </a-collapse-panel>
          <a-collapse-panel key="2" header="表单信息">
          </a-collapse-panel>
          <a-collapse-panel key="3" header="材料信息">
          </a-collapse-panel>
        </a-collapse>
      </div>
    </div>
    <div class="info-right">
      <div class="data-title">3.0数据</div>
      <div class="data-content">
        <a-collapse v-model:activeKey="activeNames">
          <a-collapse-panel key="1" header="基本信息">
            <div>项目名称：基本信息</div>
          </a-collapse-panel>
          <a-collapse-panel key="2" header="表单信息">
          </a-collapse-panel>
          <a-collapse-panel key="3" header="材料信息">
          </a-collapse-panel>
        </a-collapse>
      </div>
    </div>
  </div>
</template>
<script>
import pushLogService from '@/api/pushLogService'

export default {
  name: 'CompareInvItemInfo',
  props: {
    record: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data () {
    return {
      activeNames: [1, 2, 3], // panel默认展开指定项
      compareData: {},
      localItem: {},
      invItem: {}
    }
  },
  async mounted () {
    console.log('====》 record', this.record)
    const params = {
      projectCode: this.record.PROJECTCODE,
      uniqueNum: this.record.UNIQUENUM,
      extSendId: this.record.EXTSENDID,
      messageType: this.record.MESSAGETYPE
    }
    this.compareData = await pushLogService.getLocalInvProjectData(params)
    console.log('====> compareData:', this.compareData)
    for (const [key, value] of this.compareData) {
      console.log(key, value)
      // 如果是本地对象
      if (key === 'LOCAL_ITEM') {
        this.localItem = {
          id: 6617,
          area_code: '330452',
          approve_type: '04',
          deal_state: null,
          project_state: 'ITEM_BLZ',
          dept_id: 'ff8080815dfd3779015dfe2f34fe1900',
          dept_name: null,
          exchange_time: '2023-11-09 14:31:30',
          item_code: '330000_JSGCJGGHHS',
          item_name: '建设工程竣工规划核实',
          project_code: '2105-330452-04-01-520877',
          reply_file: null,
          reply_file_name: null,
          reply_number: null,
          reply_result: null,
          unique_num: '330452231109897039481',
          unit_orgcoding: '001008004010006',
          unit_uniquecoding: '000402ZF060000',
          project_id: 1550814,
          unaccept_project_id: null,
          process_state: null,
          modifier: 'sk2785',
          modify_time: '2023-11-10 10:26:14',
          consultation_project_id: null,
          consProcInstId: null,
          consFlowRevisionId: null,
          source: 'investment_three_old',
          creatTime: '2023-11-09 14:46:14'
        }
      } else if (key === 'INV_ITEM') {
        this.invItem = {
          approve_type: '04',
            deal_state: 'ITEM_BJ',
          dept_id: 'ff8080815dfd3779015dfe2f34fe1900',
          dept_name: '嘉兴市自然资源和规划局港区分局',
          exchange_time: '2023-11-09 15:42:46',
          item_code: '330000_JSGCJGGHHS',
          item_form: [],
          item_name: '建设工程竣工规划核实',
          project_code: '2105-330452-04-01-520877',
          reply_file: 'EcaFiles/2023_11/e2088d17-7435-474f-ace2-fefbaad8543a.pdf',
          reply_file_name: '规划核实确认书.pdf',
          reply_number: '330401202340035',
          reply_result: '1',
          unique_num: '330452231109897039481',
          unit_orgcoding: '001008004010006',
          unit_uniquecoding: '000402ZF060000',
          area_code: null,
          source: null
        }
      }
    }
  },
  methods: {

  }
}
</script>

<style scoped lang="less">
.info-root {
  width: 100%;
  height: 100%;
  padding-left: 20px;
  padding-right: 20px;
}
.info-title {
  font-size: larger;
}
.data-title {
  font-size: larger;
  margin: 5px 5px 5px 5px;
}
.info-left {
  float: left;
  width: 50%;
  height:100%;
  padding-right: 5px;
  margin-top: 10px;
  border-top: 2px gray dashed;
  border-right: 1px solid;
}
.info-right {
  float: right;
  width: 50%;
  height:100%;
  padding-left: 5px;
  margin-top: 10px;
  border-top: 2px gray dashed;
  border-left: 1px solid;
}
</style>
